QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Drawing to an Echo Port

Some video output devices can display video simultaneously on an external video display and in a window on a computer's desktop. To use this feature, your software draws to a graphics port for the window on the computer's desktop, known as the echo port, rather than the port that is normally used for the video output device. The video then appears on both displays, although in some cases the video on the desktop is displayed at a smaller size or lower frame rate.

To draw to both outputs at the same time, do the following:

  1. Call the ComponentFunctionImplemented function to determine if the video output component supports the QTVideoOutputSetEchoPort function.
  2. Call the QTVideoOutputSetEchoPort function to specify a window on the desktop in which to display video sent to the device.
  3. Call the SetMovieGWorld function to specify the same window for the output of a movie.

This process is shown in Listing 3 .

Listing 3Drawing to an echo port

Movie aMovie;
ComponentInstance ci;
CGrafPtr thePort;

/* instantiation of the video output component here */
/* creation of the graphics port here */

if (ComponentFunctionImplemented(ci, kQTVideoOutputSetEchoPortSelect)) {
result = QTVideoOutputSetEchoPort(ci, thePort);
SetMovieGWorld (aMovie, thePort, nil);
StartMovie (aMovie);
}

The video then appears on both displays. Note that you bypass the graphics world that is normally used for the video output device; your software draws only to the echo port you specify with the QTVideoOutputSetEchoPort function.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next